package top.rzhsky.util;

import javafx.scene.control.Alert;
import javafx.scene.control.ButtonType;

import java.util.Optional;

/**
 * @author rzh
 * time: 2018-11-29 16:37
 */
public class AlertUtil {
    public static Optional<ButtonType> alert(String title, String context, Alert.AlertType type, ButtonType... buttons){
        Alert alert = new Alert(type, context, buttons);
        alert.setTitle(title);
        alert.setHeaderText(null);
        return alert.showAndWait();
    }
}
